﻿

/*
NAILSUPERSTORE ® COMPANY
 
[HISTORY]
Created By  	: NGUYEN VAN TY
Created Date	: 12/14/2010
Modified By     :
Modified Date   :
Note            :

*/

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using CommonTagTime.DataAccess;
using CommonTagTime.ModelObject;
namespace CommonTagTime.Business
{
    public class busDistributor
    {
        //------------------------------------------------
        //FIELD TABLE
        //------------------------------------------------
        public const string TABLE = "Distributor";
        public const string DISTRIBUTORID = "DistributorID";      
        public const string COUNTRYCODE = "CountryCode";     
        public const string COMPANYNAME = "CompanyName";     
        public const string CONTACTNAME = "ContactName";     
        public const string ADDRESS1 = "Address1";     
        public const string ADDRESS2 = "Address2";     
        public const string STATECODE = "StateCode";     
        public const string CITY = "City";     
        public const string ZIPCODE = "ZipCode";     
        public const string PROVINCE = "Province";     
        public const string PHONE = "Phone";     
        public const string FAX = "Fax";     
        public const string NOTE = "Note";
        public const string ISACTIVE = "IsActive";
        public const string EMAIL = "Email";    
        
        
        public const string ORDERDIRECTION = "OrderDirection";
        public const string CURRENTPAGE = "CurrentPage";
        public const string PAGESIZE = "PageSize";     
        public const string TOTALRECORDS = "TotalRecords";
        public const string CONDITION = "Condition";


        private daoDistributor _daoDistributor;
        //------------------------------------------------
        //PUBLIC
        //------------------------------------------------
        public busDistributor()
        {
            _daoDistributor = new daoDistributor();
        }
        public bool Insert(Distributor objDistributor)
        {
            return _daoDistributor.Insert(objDistributor);
        }
        public DistributorCollection List(Distributor distributor)
        {
            return _daoDistributor.List(distributor);
        }
        public bool Delete(int distributorID)
        {
            if (distributorID <= 0)
                return false;            
            return _daoDistributor.Delete(distributorID);
        }
        public bool Active(int distributorID)
        {
            if (distributorID <= 0)
                return false;
            return _daoDistributor.Active(distributorID);
        }
        public bool DeActive(int distributorID)
        {
            if (distributorID <= 0)
                return false;
            return _daoDistributor.DeActive(distributorID);
        }
        public Distributor GetByID(int _distributorID)
        {
            return _daoDistributor.GetByID(_distributorID);
        }
        public bool Update(Distributor objDistributor)
        {
            return _daoDistributor.Update(objDistributor);
        }
        public DistributorCollection GetByCountryId(int countryId)
        {
            return _daoDistributor.GetByCountryId(countryId);
        }
    }
}
